import Taro from '@tarojs/taro'
import {View, Image, Text} from '@tarojs/components'

import './index.less'

export default class FundingItem extends Taro.Component {

  navigateTo = url => {
    Taro.navigateTo({url: url})
  }

  render() {
    const {item = {}} = this.props

    return (
      <View className='item' onClick={this.navigateTo.bind(this, `/pages/funding_detail/index?id=${item.id}`)}>
        <View className='img-wrapper'>
          <Image mode='widthFix' className='img' src={item.img}/>
        </View>
        <View className='info-wrapper'>
          <Text className='title'>{item.name}</Text>
          <View className='meta'>
            <View>
              <Text className='address'>{item.city_name}</Text><Text className='address'>{item.desc} </Text>
            </View>
            <View className='need'>{item.need}</View>
          </View>
        </View>
      </View>
    )
  }
}